﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BlogInfo.aspx.cs" Inherits="BlogDH.User.BlogInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../Css/usercenter.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="container">
        <div class="header">
            <a href="">博客导航</a>
        </div>
        <div class="main">
            <div class="left">
                <ul>
                    <li><a href="index.aspx">个人信息</a></li>
                    <li><a href="changepwd.aspx">密码修改</a></li>
                    <li><a href="javascript:void(0);">博客信息</a></li>
                </ul>
            </div>
            <div class="right">
                <p>
                    <label>
                        博客地址：</label>
                    <input type="text" id="burl" name="burl" readonly="readonly" value="<%=blogInfo.BlogUrl %>" />
                </p>
                <form id="form1" action="BlogInfo.aspx" method="post">
                <p>
                    <label>
                        博客名称：</label>
                    <input type="text" id="bname" name="bname" maxlength="9" value="<%=blogInfo.BlogName %>" /><span
                        class="error" id="errname"><%=errname%>
                    </span>
                </p>
                <p>
                    <label>
                        标签：</label>
                    <input type="text" id="btag" name="btag" maxlength="16" value="<%=blogInfo.BlogTags %>" /><span
                        class="error" id="errtag"><%=errtags%>
                    </span>
                </p>
                <p>
                    <label>
                        描述：</label>
                    <textarea id="bdesc" name="bdesc" title="关于博客的简单介绍" onkeydown="LimitTextArea(this)"
                        onkeyup="LimitTextArea(this)" onpropertychange="LimitTextArea(this)" cols="16"
                        rows="6" style="height: 130px;"><%=blogInfo.BlogDesc %></textarea><span class="error"
                            id="errdesc"><%=errdesc %></span>
                </p>
                <p>
                    <label>
                        成立时间：</label>
                    <select id="syear" onchange="document.getElementById('year').value=this.options[this.selectedIndex].value">
                        <%--                        <option value="2013">2013年</option>
                        <option value="2014">2014年</option>--%>
                    </select>
                    <select id="smonth" onchange="document.getElementById('month').value=this.options[this.selectedIndex].value">
                        <%--                        <option value="1">1月</option>
                        <option value="2">2月</option>
                        <option value="3">3月</option>
                        <option value="4">4月</option>
                        <option value="5">5月</option>
                        <option value="6">6月</option>
                        <option value="7">7月</option>
                        <option value="8">8月</option>
                        <option value="9">9月</option>
                        <option value="10">10月</option>
                        <option value="11">11月</option>
                        <option value="12">12月</option>--%>
                    </select><span class="error" id="errtime"> </span>
                </p>
                <p style="margin-left: 110px; margin-top: 20px;">
                    <input type="checkbox" id="isw" class="other" onclick="if(this.checked==true){document.getElementById('iswww').value=1}else{document.getElementById('iswww').value=0}" />
                    <label for="isw" class="other">
                        带WWW</label></p>
                <p>
                    <input type="checkbox" id="show" class="other" onclick="if(this.checked==true){document.getElementById('isshow').value=1}else{document.getElementById('isshow').value=0}" />
                    <label for="show" style="" class="other">
                        是否展示</label></p>
                <input type="submit" class="button" name="commit" style="margin: 30px 0 0 260px"
                    value="保存" onclick="return gosubmit();" />
                <input type="hidden" id="iswww" name="iswww" value="<%=blogInfo.IsWWW %>" />
                <input type="hidden" id="isshow" name="isshow" value="<%=blogInfo.IsShow %>" />
                <input type="hidden" id="year" name="year" value="<%=blogInfo.CreateYear %>" />
                <input type="hidden" id="month" name="month" value="<%=blogInfo.CreateMouth %>" />
                </form>
            </div>
        </div>
        <div class="footer">
        </div>
    </div>
    <script type="text/javascript">
        if (document.getElementById('iswww').value == 1)
            document.getElementById('isw').checked = true;
        if (document.getElementById('isshow').value == 1)
            document.getElementById('show').checked = true;
        var objY = document.getElementById('syear');
        var objM = document.getElementById('smonth');
        for (var i = new Date().getFullYear(); i > 2000; i--) {

            objY.options.add(new Option(i + "年", i));
            if (document.getElementById("year").value == i)
                objY.options[objY.options.length - 1].selected = true;
        }
        for (var i = 1; i < 13; i++) {
            objM.options.add(new Option(i + "月", i));
            if (document.getElementById("month").value == i)
                objM.options[objM.options.length - 1].selected = true;
        }

        function gosubmit() {
            var ret = false;
            if (document.getElementById("bname").value.length == 0) {
                document.getElementById("errname").innerHTML = "*";
            } else if (document.getElementById("btag").value.length == 0) {
                document.getElementById("errtag").innerHTML = "*";
            } else if (document.getElementById("bdesc").value.length == 0) {
                document.getElementById("errdesc").innerHTML = "*";
            } else if (document.getElementById("bdesc").value.length > 96) {
                document.getElementById("errdesc").innerHTML = "超出最大输入范围";
            } else { ret = true; }
            return ret;
        }
        function LimitTextArea(field) {
            maxlimit = 96;
            if (field.value.length > maxlimit)
                field.value = field.value.substring(0, maxlimit);
            document.getElementById("errdesc").innerHTML = "还可以输入" + (maxlimit - field.value.length) + "个";
        }
    </script>
</body>
</html>
